//package cn.lhemi.iotweb.configure;
//
//import lombok.AllArgsConstructor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
///**
// * @author tutu11
// * @description 安全设置
// * @date 2020-03-13 09:13:56
// */
////@Configuration
//@AllArgsConstructor
//public class WebSecurityConfigure extends WebSecurityConfigurerAdapter implements WebMvcConfigurer {
//    private final AuthenticationPoint authEntryPoint;
//    private final UserDetailsService userDetailsService;
//
//
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        http
//                .authorizeRequests().anyRequest().authenticated()
//                .and().httpBasic().authenticationEntryPoint(authEntryPoint);
////        http.cors().and().csrf().disable();
////        // 所有的请求都要验证
////        http.authorizeRequests().anyRequest().authenticated();
////
////        // 使用authenticationEntryPoint验证 user/password
////        http.httpBasic().authenticationEntryPoint(authEntryPoint).and();
//    }
//
//    @Override
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//        auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
//    }
//
//
//    @Bean
//    public PasswordEncoder passwordEncoder() {
//        return new BCryptPasswordEncoder();
//    }
//}
